{% extends "freeadmin/generic_form.html" %}
{% block onSubmit %}
doSubmit({
    form: this,
    event: e,
    url: '{{ request.path }}',
    longRunning: true,
    progressbar: {
      steps: [
         {"label": gettext("Installing packages")}
      ],
      poolUrl: '{% url "system_update_progress" %}',
      fileUpload: false
    }
});
{% endblock %}
{% block form %}
<tr>
  <td>
{% if update_applied %}
    <p>{% blocktrans with update_applied_msg=update_applied_msg%}{{ update_applied_msg }}{% endblocktrans %}</p>
{% elif update %}
{% if update.Notice %}
<strong>{% trans "NOTICE" %}: {{ update.Notice }}</strong>
{% endif %}
{% if update.Notes %}
{% for note, url_ in update.Notes.items %}
<p><a href="{{ url_ }}" target="_blank">{{ note }}</a></p>
{% endfor %}
{% endif %}

{% if changelog %}
{% trans "Changelog" %}:
<pre style="padding: 8px; margin: 4px; max-height: 100px; overflow: auto;">{{ changelog }}</pre>
{% endif %}

{% trans "The following packages will be changed:" %}
<pre style="padding: 8px; margin: 4px;">{{ handler.output }}</pre>
{% trans "Are you sure you want to continue?" %}{% if handler.reboot %} {% trans "The system will be rebooted after updates are applied." %}{% endif %}
{% else %}
    <p>{% trans "No updates available" %}</p>
{% endif %}
  </td>
</tr>
{% endblock %}

{% block oklabel %}
{% trans "Update" %}
{% endblock %}

{% block buttons %}
{% if update and not update_applied %}
{{ block.super }}
{% else %}
<button id="btn_Update_Close" data-dojo-type="dijit.form.Button"type="button">
    {% trans "Close" %}
    <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
        cancelDialog(this);
    </script>
</button>
{% endif %}
{% endblock %}
